package club.hicode.daydayup.filelock;

import cn.hutool.core.thread.ThreadUtil;
import org.junit.Test;
import sun.nio.ch.DirectBuffer;

import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

/**
 * 第一步测试
 *
 * @author Liu Chunfu
 * @date 2018-06-06 下午12:01
 **/
public class Step1 {
    @Test
    public void test1() throws InterruptedException {
        System.out.println("hello");
        ByteBuffer bb = ByteBuffer.allocateDirect(1024 * 1024 * 128);
        Thread.sleep(10000);
        System.out.println("clean running...");
        ((DirectBuffer) bb).cleaner().clean();

        Thread.sleep(10000);
    }

    @Test
    public void test2() {
        String ss = "123";
        ThreadUtil.sleep(5, TimeUnit.SECONDS);
        System.out.println(123);
    }
}
